package org.insia.smartposse.mapping.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the job_project table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="job_project"
 */

public abstract class BaseJobProject  implements Serializable {

	public static String REF = "JobProject";
	public static String PROP_AUCTION = "Auction";
	public static String PROP_SKILL = "Skill";
	public static String PROP_SALARY = "Salary";
	public static String PROP_PROJECT = "Project";
	public static String PROP_FREELANCE = "Freelance";
	public static String PROP_ID = "Id";


	// constructors
	public BaseJobProject () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseJobProject (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseJobProject (
		java.lang.Integer id,
		boolean auction,
		double salary) {

		this.setId(id);
		this.setAuction(auction);
		this.setSalary(salary);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private boolean auction;
	private double salary;

	// many to one
	private org.insia.smartposse.mapping.Users freelance;
	private org.insia.smartposse.mapping.Projects project;
	private org.insia.smartposse.mapping.Skills skill;

	// collections
	private java.util.Set<org.insia.smartposse.mapping.Application> applicationList;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="increment"
     *  column="job_project_id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: auction
	 */
	public boolean isAuction () {
		return auction;
	}

	/**
	 * Set the value related to the column: auction
	 * @param auction the auction value
	 */
	public void setAuction (boolean auction) {
		this.auction = auction;
	}



	/**
	 * Return the value associated with the column: salary
	 */
	public double getSalary () {
		return salary;
	}

	/**
	 * Set the value related to the column: salary
	 * @param salary the salary value
	 */
	public void setSalary (double salary) {
		this.salary = salary;
	}



	/**
	 * Return the value associated with the column: freelance_id
	 */
	public org.insia.smartposse.mapping.Users getFreelance () {
		return freelance;
	}

	/**
	 * Set the value related to the column: freelance_id
	 * @param freelance the freelance_id value
	 */
	public void setFreelance (org.insia.smartposse.mapping.Users freelance) {
		this.freelance = freelance;
	}



	/**
	 * Return the value associated with the column: project_id
	 */
	public org.insia.smartposse.mapping.Projects getProject () {
		return project;
	}

	/**
	 * Set the value related to the column: project_id
	 * @param project the project_id value
	 */
	public void setProject (org.insia.smartposse.mapping.Projects project) {
		this.project = project;
	}



	/**
	 * Return the value associated with the column: skill_id
	 */
	public org.insia.smartposse.mapping.Skills getSkill () {
		return skill;
	}

	/**
	 * Set the value related to the column: skill_id
	 * @param skill the skill_id value
	 */
	public void setSkill (org.insia.smartposse.mapping.Skills skill) {
		this.skill = skill;
	}



	/**
	 * Return the value associated with the column: ApplicationList
	 */
	public java.util.Set<org.insia.smartposse.mapping.Application> getApplicationList () {
		return applicationList;
	}

	/**
	 * Set the value related to the column: ApplicationList
	 * @param applicationList the ApplicationList value
	 */
	public void setApplicationList (java.util.Set<org.insia.smartposse.mapping.Application> applicationList) {
		this.applicationList = applicationList;
	}

	public void addToApplicationList (org.insia.smartposse.mapping.Application application) {
		if (null == getApplicationList()) setApplicationList(new java.util.TreeSet<org.insia.smartposse.mapping.Application>());
		getApplicationList().add(application);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof org.insia.smartposse.mapping.JobProject)) return false;
		else {
			org.insia.smartposse.mapping.JobProject jobProject = (org.insia.smartposse.mapping.JobProject) obj;
			if (null == this.getId() || null == jobProject.getId()) return false;
			else return (this.getId().equals(jobProject.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}